﻿/******************************************************************************
* File description: ControlPannelInfo.qml
* Function: 实验控制信息组件（已弃用）
* Current Version: 1.0.0
* Author: JNN
* Date: 2025-07-01
*  -----
*  Copyright by 博坤生物 .
 *****************************************************************************/
import QtQuick 2.0

import "../components"

Item {

    id: root
    property color color: "#F7F6FF"
    property string title: "语音模块"
    property string content: "正常"
    property string icon: "qrc:/picture/controlPannelButton/speech.png"

    signal clicked()

    height: 92*dp; width: 120*dp

    Column{
        anchors.fill: parent
        // 上半部分
        CustomRectangle{
            color: root.color
            height: parent.height*0.4;  width: parent.width
            radius: 0
            radius_lt: 3*dp; radius_rt: 3*dp
            Row{
                anchors.centerIn: parent
                spacing: 5*dp
                Text {
                    text: qsTr(title)
                    font.pixelSize: config.fontsize
                }CustomImage{
                    height: 15*dp; width: height
                    source: root.icon
                    anchors.verticalCenter: parent.verticalCenter
                }
            }
        }
        // 间隔线
        Rectangle{
            color: "#444"
            height: 1;  width: parent.width
            z: 1
        }

        // 下半部分
        Item {
            height: parent.height*0.6;  width: parent.width
            Text {
                font.pixelSize: config.fontsize_1
                text: qsTr(content)
                anchors.centerIn: parent
                font.bold: true
                color: {
                    if(text === "正常" || text === "开启" || text === "连接"){
                        return "green"
                    }else if(text === "异常" || text === "关闭" || text === "断开"){
                        return "red"
                    }else{
                        return "#222"
                    }
                }
            }
            MouseArea{
                anchors.fill: parent
                onClicked: {
                    root.clicked()
                }
            }
        }
    }

    Rectangle{
        anchors.fill: parent
        border.color: "#444"
        color: "transparent"
        radius: 3*dp
    }


}
